<?php
/**
 * Created by PhpStorm.
 * User: zl
 * Date: 2017/6/2
 * Time: 19:42
 */
    require_once('../Common.php');
    require_once('../SQLBase.php');
    $query = "SELECT user.user_ID, user.user_name FROM user INNER JOIN allsection, section WHERE user.user_ID = section.user_ID AND section.section_ID = allsection.section_ID AND allsection.section_ID = '6'";

    $conn = new SQLBase();
    $result_array = array();
    $d = $conn->queryData($query);
    if($d){
        $result_array['state'] = '1';
        $result_array['drivers'] = array();
        for($i = 0; $i < $d->num_rows; $i++){
            $row = $d->fetch_array();
            $result_array['drivers'][$i] = array('user_ID'=>$row['user_ID'], 'user_name'=>$row['user_name']);
        }
    }
    else{
        $result_array['state'] = '0';
    }

    echo json_encode($result_array);




?>